<!DOCTYPE html>
<html>

	<head>
		<meta charset="utf-8">
		<title>订单详情</title>
		<meta name="viewport" content="width=device-width, initial-scale=1,maximum-scale=1,user-scalable=no">
		<meta name="apple-mobile-web-app-capable" content="yes">
		<meta name="apple-mobile-web-app-status-bar-style" content="black">
		<link rel="stylesheet" href="../css/mui.min.css" />
		<link rel="stylesheet" href="../css/main.css" />
		<link rel="stylesheet" href="../css/mui.picker.css" />
		<link rel="stylesheet" href="../css/mui.poppicker.css" />
		<link rel="stylesheet" href="../css/feedback.css" />
		<link rel="stylesheet" href="../css/mui.imageviewer.css" />

		<!--图标-->
		<link rel="stylesheet" type="text/css" href="../css/icons-extra.css" />
		<style>
			html {
				font-size: 100%;
				#background-color: #fff;
			}
			
			h5 {
				margin: 5px 7px;
			}
			
			.mui-card .mui-control-content {
				padding: 10px;
			}
			/*.mui-control-content {
				height: 550px;
			}*/
			
			ul {
				font-size: 14px;
				color: #333333;
			}
			
			.mui-btn {
				padding: 10px;
			}
			
			#kefu {
				font-size: 0.5rem;
				line-height: 30px;
			}
			
			header button img {
				width: 0.3rem;
			}
			
			.mui-bar {
				box-shadow: 0 0 1px rgba(255, 255, 255, 1);
			}
			
			.mui-content {
				#background-color: #fff;
			}
			
			.mui-segmented-control {
				border-bottom: 3px solid #eeeeee!important;
			}
			
			.mui-content .mui-segmented-control {
				border: none;
			}
			
			.right {
				float: right;
			}
			
			.mui-control-content {
				min-height: 540px;
			}
			
			.liangzi {
				text-align: center
			}
			
			.liangzi img {
				width: 25% !important;
				margin-top: 10%;
				margin-bottom: 10%;
			}
			
			.mui-content>.mui-table-view:first-child {
				margin-top: 10px !important;
			}
		</style>
	</head>

	<body>
		<header class="mui-bar mui-bar-nav">
			<a class="mui-action-back mui-icon mui-icon-left-nav mui-pull-left"></a>
			<h1 class="mui-title" id="ptitle">订单详情</h1>
		</header>
		<div class="mui-content" id="content">
			<div id="ordera"></div>
			<div id="orderb"></div>
			<div class="liangzi mui-confirm-button">
				<img src="../images/order/qiangdan.png" alt="" />
			</div>
		</div>
	</body>
	<script type="text/javascript" src="../js/mui.min.js"></script>
	<script type="text/javascript" src="../js/app.js"></script>
	<script type="text/javascript" src="../js/constants.js"></script>
	<script type="text/javascript" src="../js/sharemethods.js"></script>
	<script type="text/javascript" src="../js/xiangyingshi.js"></script>
	<script type="text/javascript" src="../js/jquery-3.1.1.min.js"></script>
	<script type="text/javascript" src="../js/mui.zoom.js"></script>
	<script type="text/javascript" src="../js/mui.previewimage.js"></script>
	
	<script type="text/javascript" src="../plugs/moment/moment.min.js"></script>
	<script type="text/javascript" src="../plugs/art/template-web.js"></script>
	<script type="text/javascript" src="../plugs/qs/qs.art.extend.js"></script>
	<script type="text/javascript" src="../plugs/qs/qs.template.js"></script>
	<script>
		mui.plusReady(function() {

			setPagePos();
			mui.init({
				swipeBack: true, //启用右滑关闭功能
				beforeback: function() {
					//获得列表界面的webview
					var i = plus.webview.getWebviewById("catch_order.html");
					if(i) {
						//触发列表界面的自定义事件（refresh）,从而进行数据刷新
						i.evalJS("getUserInfo()");
					}
					return true;
				}
			});
			mui.previewImage();
			mui('.mui-scroll-wrapper').scroll({
				indicators: true //是否显示滚动条
			});

			var self = plus.webview.currentWebview();
			var orderId = self.orderId;
			var userId = localStorage.getItem("USERID");
			var orderUrl = getorderdetailUrl + orderId;

			var ordersussess = function(data) {
				if(data.result == "success") {
					var order = data.obj;
					$("#ordera").processTL(templateRegister.ordera,data.obj)
					$("#orderb").processTL(templateRegister.orderb,data.obj)
//					processTL("orderb", function(func) {
//						$('#content').prepend(func(data.obj));
//					});
//					processTL("ordera", function(func) {
//						$('#content').prepend(func(data.obj));
//					});
				} else {
					mui.toast(data.msg);
				}
			};

			commonHttpUtils(orderUrl, "get", {
				id: orderId
			}, ordersussess, error);

			mui(".mui-content").on("tap", ".mui-confirm-button", function() {
				var url = confirmorderUrl + orderId;
				var btnArray = ['否', '是'];
				mui.confirm('是否确认接此定单并为其服务？', '抢单提示', btnArray, function(e) {
					if(e.index == 1) {
						var sussess = function(data) {
							//服务器返回响应，根据响应结果，分析是否登录成功；
							if(data.result == "success") {
								mui.toast("抢单成功");
								mui.back();
							} else {
								mui.toast(data.msg);
							}
						};
						commonHttpUtils(url, "put", {
							id: userId
						}, sussess, error);
					}
				})
			});
		});
	</script>

</html>